<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="java.net.*,java.io.*,org.json.*" %>
<%@page import="com.google.gson.Gson" %>
<%@page import="com.coach.util.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

JSONObject userInfo=null; 
int wxUserId=0;
String nickName=null;
String logoUrl=null;
String groupId=null;
String userId=null;
String openid=(String)session.getAttribute(Consts.WOA_KEY_Openid);
String unionid=null;
/*
if (openid == null) {
	String url = "index.jsp";
	String queryString = request.getQueryString();
	if (queryString != null) url += "?" + queryString;
	url = URLEncoder.encode(url, "utf-8");
	response.sendRedirect("OAuth20.jsp?url=" + url);
	return;
}else{
   userInfo=(JSONObject)session.getAttribute(Consts.WOA_KEY_UserInfo);
   unionid = userInfo == null ? "" : userInfo.optString("unionid");
   nickName = userInfo == null ? "佚名" : userInfo.optString("nickname");
   logoUrl = userInfo == null ? "" : userInfo.optString("headimgurl");
   wxUserId=Utilities.bindAccount(unionid, nickName, logoUrl);
}*/
 %>
<!DOCTYPE html>
<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
  <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1.0,user-scalable=no"> 
    <link rel="stylesheet" href="<%=basePath%>css/sm-exo.min.css">
  <link rel="stylesheet" href="<%=basePath%>css/sui.css">
  <link rel="stylesheet" type="text/css" href="<%=basePath%>css/index.css"/>
<title>嗨跑训练登录入口</title>
</head>
<body>
<div id="page-ptr" class="page page-current">

 
 <div class="content">
   <!-- 登录模块 -->
   <script type="text/template"  id="user-login-template">  
 <header class="bar bar-nav">
 <h1 class="title">嗨跑训练登录入口</h1>
 </header>
 <div class="card-content">
 <img class="card-content-img" src="<%=basePath%>images/login-bg.png">
 </div>
    <form>
    <div class="list-block">
          <div class="item-content login">
            <div class="item-media"><i class="icon icon-form-name"></i></div>
            <div class="item-inner">
              <div class="item-input">
                <input type="number" placeholder="手机号" id="login-username">
              </div>
            </div>
          </div>
          <br/>
          <div class="item-content login">
            <div class="item-media"><i class="icon icon-form-password"></i></div>
            <div class="item-inner">
              <div class="item-input">
                <input type="password" placeholder="密 码" id="login-password">
              </div>
            </div>
          </div>
          <br/>
          <div class="row"><a class="pull-right go-register" href="#">无账号，去注册？</a></div>

    </div>
    <div class="content-block">
      <div class="row">
        <div class="col-100"><a href="#" class="button button-big button-fill button-success" onclick="checklogin(this);">登录</a></div>
      </div>
    </div>
    </form>
    </script>
    
    <!-- 注册模块 -->
    <script type="text/template" id="user-register-template">
   <header class="bar bar-nav">
   <h1 class="title">嗨跑训练快速注册</h1>
   </header>
      <form>     
     <div class="card">
      <div class="card-content">
        <div class="content-block-title">为快速注册，请输入您的手机号并进行验证</div>
        <div class="card-content-inner"><input type="number" class="register-input" id="user-phoneNumber" placeholder=" 请填写手机号"></div>
        <div class="card-content-inner"><a href="#" onclick="checksendmessage();" class="button button-big button-fill button-warning">下一步</a></div>
      </div>
     </div>
     </form>    
    </script>
    
    <!-- 接收验证码模块 -->
    <script type="text/template" id="user-icode-template">
    <header class="bar bar-nav">
    <h1 class="title">嗨跑训练快速注册</h1>
    </header>
    <form>
    <div class="card">
      <div class="card-content">
        <div class="content-block-title">验证码已发送至<span class="phonenumberspan"></span></div>
        <div class="card-content-inner"><input type="number" class="identifycode-input"  placeholder=" 请输入验证码"><a href="#"  class="button button-fill sendagain-btn button-black"><span id="second-counter">60</span>秒后重新获取</a></div>
        <div class="card-content-inner"><a href="#" onclick="checkidentifycode();" class="button button-big button-fill button-warning">下一步</a></div>
      </div>
     </div>
    </form>
    </script>
    
    <!-- 验证后设置密码模块-->
    <script type="text/template" id="user-password-template">
    <header class="bar bar-nav">
    <h1 class="title">嗨跑训练快速注册</h1>
    </header>
    <form>
    <div class="card">
      <div class="card-content">
        <div class="content-block-title">请设置密码<span class="phonenumberspan"></span></div>
        <div class="card-content-inner">
        <input type="password" class="password-input" id="user-password" placeholder=" 请输入密码">
        <br><br/>
        <input type="password" class="password-input-again"  placeholder=" 再次确认密码">
        </div>
        <div class="card-content-inner"><a href="#" onclick="checkpassword();" class="button button-big button-fill button-warning select-roles">下一步</a></div>
      </div>
     </div>
    </form>
    </script>
    
    <!-- 补充user基本信息 -->
    <script type="text/template" id="user-information-template1"> 
    <header class="bar bar-nav">
    <h1 class="title">嗨跑训练用户信息补全</h1>
    </header>
     <form>
     <div class="card">
      <div class="card-content">
        <div class="content-block-title">请补充用户信息<span class="phonenumberspan"></span></div>
        <div class="card-content-inner">
        <input type="text" id="user-name" class="password-input"  placeholder=" 请输入用户姓名">
        <br><br/>
        <input type="text" placeholder="" id="city-picker" class="password-input" readonly="">
        </div>
        <div class="card-content-inner"><a href="#" onclick="checkpassword();" class="button button-big button-fill button-warning">选择用户身份</a></div>
      </div>
     </div>
     </form>
    </script>
      
    <script type="text/template" id="user-information-template"> 
    <header class="bar bar-nav">
    <h1 class="title">嗨跑训练用户信息补全</h1>
    </header>
     <form>
        <div class="content-block">
        <div class="list-block">
          <ul>
            <li>
              <div class="item-content">
                <div class="item-inner">
                  <div class="item-title label">用户名</div>
                  <div class="item-input">
                    <input type="text" placeholder="用户姓名" id='user-name'/>
                  </div>
                </div>
              </div>
            </li>
            <li>
              <div class="item-content">
                <div class="item-inner">
                  <div class="item-title label">省市区</div>
                  <div class="item-input">
                    <input type="text" placeholder="" id='city-picker'/>
                  </div>
                </div>
              </div>
            </li>
           <li>
              <div class="item-content">
                <div class="item-inner">
                  <div class="item-title label">性别</div>
                  <div class="item-input">
                  <select id="user-sex">
                  <option value="m">男</option>
                  <option value="f">女</option>
                  </select>
                  </div>
                </div>
              </div>
           </li>
            <li>
              <div class="item-content">
                <div class="item-inner">
                  <div class="item-title label">年龄</div>
                  <div class="item-input">
                    <input type="number" placeholder="用户年龄" maxlength="3" id='user-age'/>
                  </div>
                </div>
              </div>
            </li>
            <li>
              <div class="item-content">
                <div class="item-inner">
                  <div class="item-title label">身份证</div>
                  <div class="item-input">
                    <input type="number" placeholder="用户身份证" id='user-IDCard'/>
                  </div>
                </div>
              </div>
            </li>
             <li class="hidden-info">
              <div class="item-content">
                <div class="item-inner">
                  <div class="item-title label">监护人选择</div>
                  <div class="item-input">
                  <select id="user-parent">
                  <option value="0">父亲</option>
                  <option value="1">母亲</option>
                  <option value="2">其他</option>
                  </select>
                  </div>
                </div>
              </div>
             </li>
             <li class="hidden-info">
              <div class="item-content">
                 <div class="item-inner">
                  <div class="item-title label">监护人姓名</div>
                  <div class="item-input">
                    <input type="text" placeholder="监护人姓名" id='user-parent-name'/>
                  </div>
                </div>
              </div>
            </li>

          </ul>
        <div class="card-content-inner"><a href="#" onclick="checkuserinfo();" class="button button-big button-fill button-warning">完成注册</a></div>
        </div>
        </div>
     </form>
    </script>
      
     
    
  </div>
      <input type="hidden" id="user-wechatId" value="<%=wxUserId%>">
      <input type="hidden" id="user-nickName" value="<%=nickName%>">
      <input type="hidden" id="user-logoUrl" value="<%=logoUrl%>">
      <input type="hidden" id="user-hidden-password">
      <input type="hidden" id="user-hidden-phone">
      <input type="hidden" id="user-roleType">
     

</div>
  	
</body>
   <script type="text/javascript" src="<%=basePath%>js/control/zepto.min.js"></script>
   <script type="text/javascript" src="<%=basePath%>js/control/sm.min.js"></script>
   <script type="text/javascript" src="<%=basePath%>js/control/sm-extend.min.js"></script>
   <script type="text/javascript" src="<%=basePath%>js/control/sm-city-picker-min.js"></script>
   <script type="text/javascript" src='<%=basePath%>js/control/underscore.min.js'></script>
   <script type="text/javascript" src="<%=basePath%>js/custom/login.js"></script>
   <script>
   var basePath='<%=basePath%>';
   </script>
</html>


